<style lang='scss' type='stylesheet/scss' scoped>
.as-button {
  margin-bottom: 10px;
}
</style>
<template>
  <div>
    <as-h2>onConfirm / onCancel</as-h2>
    <as-card :text="text"
             title="点击确认或取消后的回调">
      <as-popconfirm title="确认提交？" @onConfirm="handlerConfirm" @onCancel="handlerCancel">
        <as-button type="primary">提交</as-button>
      </as-popconfirm>
    </as-card>
  </div>
</template>

<script type="text/ecmascript-6">
import { mapGetters } from "vuex";
export default {
  name: "",
  computed: {
    ...mapGetters(["isMobile"])
  },
  data() {
    return {
      text: `<template>
   <as-popconfirm title="确认提交？" @onConfirm="handlerConfirm" @onCancel="handlerCancel">
     <as-button type="primary">提交</as-button>
   </as-popconfirm>
 </template>
 <script>
 export default {
   methods: {
     handlerConfirm() {
       this.$message("点击了确认按钮")
     },
     handlerCancel() {
       this.$message("点击了取消按钮")
     },
   }
 }
 <\/script>`
    };
  },
  methods: {
    handlerConfirm() {
      this.$message("点击了确认按钮")
    },
    handlerCancel() {
      this.$message("点击了取消按钮")
    },
  }
};
</script>
